import request from '@/utils/requestUtil'

/**
 * 查询地址列表
 */
export function fetchAddressList() {
	return request({
		method: 'GET',
		url: '/member/address/list'
	})
}

/**
 * 查询地址详情
 * @param {Object} id
 */
export function fetchAddressDetail(id) {
	return request({
		method: 'GET',
		url: `/member/address/${id}`
	})
}

/**
 * 添加地址
 * @param {Object} data
 */
export function addAddress(data) {
	return request({
		method: 'POST',
		url: '/member/address/add',
		data:data
	})
}

/**
 * 更新地址
 * @param {Object} data
 */
export function updateAddress(data) {
	return request({
		method: 'POST',
		url: `/member/address/update/${data.id}`,
		data:data
	})
}

/**
 * 删除地址
 * @param {Object} id
 */
export function deleteAddress(id) {
	return request({
		method: 'POST',
		url: `/member/address/delete/${id}`
	})
}

